{template game_header}
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<style type="text/css">
  .boardDiv{margin-bottom: 10px;}
  .boardList{margin: 10px auto;}
  .boardList li{list-style-type:none;float:left;margin:5px 9px;background-color:#dbeaf9;padding:5px 10px;cursor:pointer;border-radius: 3px;}
  .boardList label{float: left;margin-bottom: 0;}
  .boardList label input {float: left;margin-right: 5px;}
  .tagHot label {display: inline-block;}
</style>
<h4 style="padding-left:10px;">
  <span>游戏开关</span>
</h4>
<div class="tagInfo">
  <form enctype="multipart/form-data" method="post" action="?c=adminGame&a=gameSwitch" class="form-horizontal" onsubmit="return subtn();">
      <div class="control-group">
        <label class="control-label">是否开启游戏：</label>
        <div class="controls">
          <select name="is_show">
            <option value="1">是</option>
            <option {if $gameInit['is_show'] == 0} selected="selected" {/if} value="0">否</option>
          </select>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="inputaddtime">设置游戏期限：</label>
        <div class="controls">
          开始时间：<input type="text" name="start_time" id="start_time_id" value="{eval echo $gameInit['start_time']}">
          <input name="start_time_btn" type="button" id="start_time_btn" onclick="return showCalendar('start_time_id', '%Y-%m-%d %H:%M', '24', false, 'start_time_btn');" value="选择" class="button"/><br/><br/>
          结束时间：<input type="text" name="end_time" id="end_time_id" value="{eval echo $gameInit['end_time']}">
          <input name="end_time_btn" type="button" id="end_time_btn" onclick="return showCalendar('end_time_id', '%Y-%m-%d %H:%M', '24', false, 'end_time_btn');" value="选择" class="button"/>
        </div>
      </div>

      <div class="control-group">
        <div class="controls">
            <button type="submit" onclick="subtn" class="btn">提交</button>
        </div>
      </div>
  </form>
</div>

<script>
    function subtn(){
      var startTime = $("#start_time_id").val();
      var endTime = $("#end_time_id").val();
      if(startTime == ''){
        alert("请选择开始时间");
        return false;
      }
      if(endTime == ''){
        alert("请选择结束时间");
        return false;
      }
      if(startTime >= endTime){
        alert("开始时间必须小于结束时间");
        return false;
      }
    }
</script>

{template footer}
